package com.fh.service.system.cases;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.fh.dao.DaoSupport;
import com.fh.entity.Page;

import com.fh.util.PageData;


@Service("caseService")
public class CaseService {

	@Resource(name = "daoSupport")
	private DaoSupport dao;
	
	//======================================================================================
	
	/*
	* 通过id获取数据
	*/
	public PageData findCaseById(PageData pd)throws Exception{
		return (PageData)dao.findForObject("CaseMapper.findCaseById", pd);
	}
	
	
	/*
	* 保存
	*/
	public void saveCase(PageData pd)throws Exception{
		dao.save("CaseMapper.saveCase", pd);
	}
	/*
	* 修改
	*/
	public void editCase(PageData pd)throws Exception{
		dao.update("CaseMapper.editCase", pd);
	}
	/*
	* 删除
	*/
	public void deleteCase(PageData pd)throws Exception{
		dao.delete("CaseMapper.deleteCase", pd);
	}
	/**
	 *查
	 * @param page
	 * @return
	 * @throws Exception
	 */
	public List<PageData> listAllCase(Page page)throws Exception{
		return (List<PageData>) dao.findForList("CaseMapper.listAllCase", page);
	}
	
	
	
	
}

